import request from '@/utils/request'


export function getDictTreeList(data) {
  return request({
    url: '/admin/dictTree/findList',
    method: 'get',
    params: data
  })
}
/** 修改/添加时弹出树 */
export function getDictTreeTree(data) {
  return request({
    url: '/admin/dictTree/type/'+ data.typeCode +'/' + data.extId,
    method: 'get'
  })
}

export function getDictTree(id) {
  return request({
    url: '/admin/dictTree/' + id,
    method: 'get'
  })
}

export function updateDictTree(data) {
  return request({
    url: '/admin/dictTree',
    method: 'put',
    data
  })
}

/**
 * 保存字典树
 * @param {字典树} data
 */
export function saveDictTree(data) {
  return request({
    url: '/admin/dictTree',
    method: 'post',
    data
  })
}

/**
 *  删除字典树
 * @param {id} id
 */
export function delDictTree(id) {
  return request({
    url: '/admin/dictTree/' + id,
    method: 'delete'
  })
}
